#define _Constants_h_
#include "NativeMath.h"
//#undef _Constants_h_

const BYTE BASE_TYPE_BITS = 32;
const UINT BASE_MAX_VALUE = 0xFFFFFFFF;

/*
 * Since all integers are stored in 32-bit uint arrays it is often neccessary
 * to mask out the 'extra' bits that may have been set due to eg. overflow. By convention
 * the length of the array used is the shortest possible (an 8 bit integer will be stored
 * in an array of size one and a 70 bit integer will be stored in an array of size 3). In 
 * most cases it will only be necessary to mask out unused bits in the most significant 
 * digit. This table provides a bit mask that can be used to mask out these extra bits. The
 * table should be index'ed using the width of the integer in question mod the size of the 
 * digits (32-bits). For integers with a width of 32*N (n=1,2,3..) this table will return an
 * invalid mask. 
 */
const UINT bitmasks[] =
{
	0x00000000,
	0x00000001,
	0x00000003,
	0x00000007,
	0x0000000F,
	0x0000001F,
	0x0000003F,
	0x0000007F,
	0x000000FF,
	0x000001FF,
	0x000003FF,
	0x000007FF,
	0x00000FFF,
	0x00001FFF,
	0x00003FFF,
	0x00007FFF,
	0x0000FFFF,
	0x0001FFFF,
	0x0003FFFF,
	0x0007FFFF,
	0x000FFFFF,
	0x001FFFFF,
	0x003FFFFF,
	0x007FFFFF,
	0x00FFFFFF,
	0x01FFFFFF,
	0x03FFFFFF,
	0x07FFFFFF,
	0x0FFFFFFF,
	0x1FFFFFFF,
	0x3FFFFFFF,
	0x7FFFFFFF,
	0xFFFFFFFF
};

const UINT bitmasks2[] =
{
	0xFFFFFFFF,
	0x00000000,
	0x00000001,
	0x00000003,
	0x00000007,
	0x0000000F,
	0x0000001F,
	0x0000003F,
	0x0000007F,
	0x000000FF,
	0x000001FF,
	0x000003FF,
	0x000007FF,
	0x00000FFF,
	0x00001FFF,
	0x00003FFF,
	0x00007FFF,
	0x0000FFFF,
	0x0001FFFF,
	0x0003FFFF,
	0x0007FFFF,
	0x000FFFFF,
	0x001FFFFF,
	0x003FFFFF,
	0x007FFFFF,
	0x00FFFFFF,
	0x01FFFFFF,
	0x03FFFFFF,
	0x07FFFFFF,
	0x0FFFFFFF,
	0x1FFFFFFF,
	0x3FFFFFFF,
	0x7FFFFFFF			
};